
<script>
import Player from "@/components/player/player.vue";
import Charge from "@/components/charge/charge.vue";
const { PlayletExtension, getPlayletManager } = tt;
PlayletExtension();

export default {
  components: { Player, Charge },
  //采用uniapp的生命周期函数
  onLoad(option) {
    console.log(option);
    const pm = getPlayletManager(this);
    console.error(pm, "onLoad_pm_vue2");
  },
  onReady() {
    const p_m = getPlayletManager(this);
    console.error(p_m,'pm')
    console.log(p_m, "onReady_pm_vue2");
    p_m.setCatalog({
        freeList: [
          {
            start_episode_no: 1,
            end_episode_no: 5,
          },
        ],
        unlockList: [
          {
            start_episode_no: 6,
            end_episode_no: 10,
          },
          {
            start_episode_no: 16,
            end_episode_no: 20,
          },
        ],
        lockList: [
          {
            start_episode_no: 11,
            end_episode_no: 15,
          },
          {
            start_episode_no: 21,
            end_episode_no: 76,
          },
        ],
      });
    p_m.setConfig({
      activityInfo: [
        {
          icon: "https://img95.699pic.com/xsj/0c/1m/7e.jpg%21/fw/700/watermark/url/L3hzai93YXRlcl9kZXRhaWwyLnBuZw/align/southeast",
          title: "开辅助",
        },
      ],
    });
    p_m.onPlay((e) => {
      console.error("可以播放了，可以播放了，可以播放了，可以播放了", e);
    });
    p_m.onError((e) => {
      console.error("插件页onload  报错了 报错了", e);
    });
    p_m.onPause((e) => {
      console.error("触发暂停播放onPause回调:", e);
    });
  },
  onShow() {
    console.log("show");
  },
  mounted() {
    console.error(this, "this");

    const child = this.$refs.childRef;
    console.error(child, this.$refs, "childRef");
  },
  onShareAppMessage() {
    console.log("share");
  },
  methods: {
    cliPause(num) {
      console.log(num, "cliPause");
    },
  },
};
</script>
